package com.zc.blog.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.zc.blog.util.CustomDateTimeSerializer;

import java.util.Date;
import java.util.List;

/**
 * 文章实体类
 */
@TableName("t_article")
public class Article {

    @TableId(type = IdType.AUTO)
    private Integer id; //编号

    private String title;  //文章标题

    private String image;  //文章首页图片

    @JsonSerialize(using= CustomDateTimeSerializer.class)
    private Date releaseDate; // 发布日期

    private String content;  //文章内容

    private boolean slider=false; //是否轮播

    private Integer sliderSort; //轮播图排序

    private Integer click;   //点击量

    private Integer categoryId; //文章类别id

    private Integer userId; //发布用户id

    @TableField(select = false)
    private Category category;  // 所属文章类别

    @TableField(select = false)
    private User user; // 发布用户

    @TableField(select = false)
    private List<Tag> tagList; // 文章所有标签

    @TableField(select = false)
    private Long countComment; //评论总数

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Date getReleaseDate() {
        return releaseDate;
    }

    public void setReleaseDate(Date releaseDate) {
        this.releaseDate = releaseDate;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isSlider() {
        return slider;
    }

    public void setSlider(boolean slider) {
        this.slider = slider;
    }

    public Integer getSliderSort() {
        return sliderSort;
    }

    public Integer getClick() {
        return click;
    }

    public void setClick(Integer click) {
        this.click = click;
    }

    public void setSliderSort(Integer sliderSort) {
        this.sliderSort = sliderSort;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public List<Tag> getTagList() {
        return tagList;
    }

    public void setTagList(List<Tag> tagList) {
        this.tagList = tagList;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Long getCountComment() {
        return countComment;
    }

    public void setCountComment(Long countComment) {
        this.countComment = countComment;
    }
}
